class DrawEncapsulation{
    drawCanvas = null;

    config = {
        edit: true,
        grig: true,
        mirror: false,
        rotate: 0,
        gridSize:{
            x: 0.5,
            y: 0.5
        },
        smallDist:{
            x: 0,
            y: 0
        }
    }
    
    /**
     * @type {HTMLElement}
     */
    parent = null;

    /**
     * 当前显示的层级
     */
    viewStatus = {
        boardLayer:[],
        pinLayer:[]
    }

    // 编辑的历史记录
    history = {
        historyList:[],
        nowStatus:0
    }

    constructor(options){
        this.parent = util.getElement(options.parent);
        this.encapsulation = new Encapsulation(options.encaData);
        this.drawCanvas = new EncapsulationCanvas(this.parent);
        this.drawCanvas.setUser(this);
        this.setOrigin();
        this.draw();
    }

    setOrigin(){
        this.drawCanvas.setOrigin({x: 0,y: 0})
    }

    changeView({layer,pin}){
        this.changeLayerView(layer);
        this.changePinLayerView(pin);
    }

    changeLayerView(layerStatus){

    }

    changePinLayerView(pinStatus){

    }

    draw(){
        this.drawCanvas.draw();
    }
}